package com.ocom.wxapi.client;

import com.alibaba.fastjson.JSONObject;
import com.ocom.common.constant.AccessServiceUrl;
import com.ocom.common.dto.AreaDto;
import com.ocom.common.request.wx.QrPageOnLoadRequest;
import com.ocom.common.request.wx.UserAccessPageSetAccessRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.vo.BindMachVo;
import com.ocom.common.vo.SearchMachListVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;


@FeignClient(value = "access")
public interface AccessClientService {


    @PostMapping(AccessServiceUrl.URL_getMachineCountById)
    Result getCountByComId(@RequestParam("companyId") Long companyId);


    @PostMapping(AccessServiceUrl.URL_WxGetAreaInfo)
    Result getAreaList(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId);


    @PostMapping(AccessServiceUrl.URL_UpdateAreaName)
    Result UpdateAreaName(@RequestBody AreaDto areaDto);



    @PostMapping(AccessServiceUrl.URL_getUserAccessListByArea)
    Result getUserAccessListByArea(@RequestParam("companyId")Long companyId,@RequestParam("areaNo")Long areaNo);


    @PostMapping(AccessServiceUrl.URL_getGroupListByArea)
    Result getGroupListByArea(@RequestParam("companyId")Long companyId,@RequestParam("areaNo")Long areaNo);


    @PostMapping(AccessServiceUrl.URL_WxGetAreaInfoById)
    Result getAreaInfoById(@RequestParam("companyId")Long companyId,@RequestParam("areaNo")Long areaNo);



    @PostMapping(AccessServiceUrl.URL_WxChangeAccess)
    Result setAccess(@RequestBody UserAccessPageSetAccessRequest request);


    @PostMapping(AccessServiceUrl.URL_WxGetAccessByUser)
    Result getAccessByUser(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId);


    @PostMapping(AccessServiceUrl.URL_getMachineInfoByMachNo)
    Result getMachineInfoById(@RequestParam("companyId")Long companyId,@RequestParam("machNo")String machNo);


    @PostMapping(AccessServiceUrl.URL_updateMachNameByMachNo)
    Result updateMachNameByMachNo(@RequestParam("companyId")Long  companyId,@RequestParam("machNo")String machNo,@RequestParam("machName") String machName);

    @PostMapping(AccessServiceUrl.URL_WXchangeMachPlace)
    Result  changeMachPlace(@RequestParam("companyId")Long companyId,@RequestParam("machNo")String machNo,@RequestParam("areaNo")Long areaNo);

    @PostMapping(AccessServiceUrl.URL_WXremoveMach)
    Result   removeMach(@RequestParam("companyId")Long companyId,@RequestParam("machNo")String machNo);

    @PostMapping(AccessServiceUrl.URL_RemoveArea)
    Result   RemoveArea(@RequestBody AreaDto areaDto);


    @PostMapping(AccessServiceUrl.URL_WxNewArea)
    public Result newArea(@RequestParam("companyId")Long companyId,@RequestParam("regionId")Long regionId,@RequestParam("areaName")String areaName,@RequestParam("pId")Long pId);

    @PostMapping(AccessServiceUrl.URL_BindMach)
    Result BindMach(@RequestBody BindMachVo bindMachVo);


    @PostMapping(AccessServiceUrl.URL_SearchMachList)
    Result SearchMachList(@RequestBody SearchMachListVo searchMachListVo);


    @PostMapping(AccessServiceUrl.URL_getMachineListOnLoad)
    Result getMachineListOnLoad(@RequestParam("companyId")Long companyId);


    @PostMapping(AccessServiceUrl.URL_newQrCode)
    Result newQrCode(@RequestBody QrPageOnLoadRequest request);


    @PostMapping(AccessServiceUrl.URL_pollingQrCode)
    Result pollingQrCode(@RequestParam("qrCode")String qrCode ,@RequestParam("pollingTimes")Integer pollingTimes);

    @PostMapping(AccessServiceUrl.URL_Removeuser)
    Result Removeuser(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId);


    @PostMapping(AccessServiceUrl.URL_AccessRemoveWhiteUser)
    Result removeWhiteUser(@RequestParam("companyId")Long companyId,@RequestParam("pId")Long pId);

    @PostMapping(AccessServiceUrl.URL_clearAccessByUser)
    Result clearAccessByUser(@RequestParam("companyId")Long companyId,@RequestParam("pId") Long pId,@RequestParam("userId") Long userId);


    /**
     * 健康码人数（LargeScreen/getYkmNums）
     */
    @GetMapping(AccessServiceUrl.URL_LargeScreenGetYkmNums)
    public Result LargeScreenGetYkmNums(@RequestParam("comId")Long comId);

    /**
     * 核酸检测归类统计（LargeScreen/getYkmSumByHS）
     * */
    @GetMapping(AccessServiceUrl.URL_LargeScreenGetYkmSumByHS)
    public Result LargeScreenGetYkmSumByHS(@RequestParam("comId")Long comId);

    /**
     * 疫苗接种归类统计（LargeScreen/getYkmSumByYM）
     * */
    @GetMapping(AccessServiceUrl.URL_LargeScreenGetYkmSumByYM)
    public Result LargeScreenGetYkmSumByYM(@RequestParam("comId")Long comId);

    //2.8.5防疫信息汇总统计（getYkmPersonnelSum）
    @PostMapping(AccessServiceUrl.URL_GetYkmPersonnelSum)
    Result getYkmPersonnelSum(@RequestBody Map<String,Object> map);

    /**获取区域信息*/
    @GetMapping(AccessServiceUrl.URL_GetAreaInfo)
    public Result GetAreaInfo(@RequestParam("comId") Long comId);

    /**
     * 防疫汇总指标列表详情（getYkmSumList）
     * */
    @PostMapping(AccessServiceUrl.URL_getYkmSumList)
    public Result getYkmSumList(@RequestBody Map<String,Object> map);


}


